﻿using System;
using System.Windows.Input;

namespace HCAD.CircularWorkingScaffoldAssistant.Component.Infrastructure
{
    public class FlowCommand : ICommand, IFlowCommand
    {
        private bool canExecute = true;

        public void Execute(object parameter)
        {
            ExecuteAction();
        }

        public bool CanExecute(object parameter)
        {
            return canExecute;
        }

        public event EventHandler CanExecuteChanged = delegate { };

        public event Action ExecuteAction = delegate { };

        public void SetCanExecute(bool newValue)
        {
            canExecute = newValue;
            CanExecuteChanged(this, EventArgs.Empty);
        }
    }
}